package com.shw.loco.vo;

import java.io.Serializable;

import com.shw.loco.util.InfoUtils;

/**
 * 
 * @author HAHA
 * 
 */
public class SendInfo implements Serializable {

	private String terminalid="";
	private String sdDate;
	private String sdTrackNo;
	private String sdAreaNo;
	private String sdFlag;
	private String sdMilCoordinate;
	private String sdSpeed;
	private String sdLon;
	private String sdLat;
	private String sdMilRFID;
	private String sdStatus;
	private String sdReserve;

	
	public String getTerminalid() {
		return terminalid;
	}

	public void setTerminalid(String terminalid) {
		this.terminalid = terminalid;
	}

	public String getSdDate() {
		return sdDate;
	}

	public void setSdDate(String sdDate) {
		this.sdDate = sdDate;
	}

	public String getSdTrackNo() {
		return sdTrackNo;
	}

	public void setSdTrackNo(String sdTrackNo) {
		this.sdTrackNo = sdTrackNo;
	}

	public String getSdAreaNo() {
		return sdAreaNo;
	}

	public void setSdAreaNo(String sdAreaNo) {
		this.sdAreaNo = sdAreaNo;
	}

	public String getSdFlag() {
		return sdFlag;
	}

	public void setSdFlag(String sdFlag) {
		this.sdFlag = sdFlag;
	}

	public String getSdMilCoordinate() {
		return sdMilCoordinate;
	}

	public void setSdMilCoordinate(String sdMilCoordinate) {
		this.sdMilCoordinate = sdMilCoordinate;
	}

	public String getSdSpeed() {
		return sdSpeed;
	}

	public void setSdSpeed(String sdSpeed) {
		this.sdSpeed = sdSpeed;
	}

	public String getSdLon() {
		return sdLon;
	}

	public void setSdLon(String sdLon) {
		this.sdLon = sdLon;
	}

	public String getSdLat() {
		return sdLat;
	}

	public void setSdLat(String sdLat) {
		this.sdLat = sdLat;
	}

	public String getSdMilRFID() {
		return sdMilRFID;
	}

	public void setSdMilRFID(String sdMilRFID) {
		this.sdMilRFID = sdMilRFID;
	}

	public String getSdStatus() {
		return sdStatus;
	}

	public void setSdStatus(String sdStatus) {
		this.sdStatus = sdStatus;
	}

	public String getSdReserve() {
		return sdReserve;
	}

	public void setSdReserve(String sdReserve) {
		this.sdReserve = sdReserve;
	} 

	public String toNetString() {
		StringBuffer sb=new StringBuffer("67");
		sb.append(InfoUtils.leftAdding(terminalid, "0", 4));
		sb.append("0339");
		sb.append(this.getSdDate()).append(getSdTrackNo()).append(getSdAreaNo()).append(getSdFlag()).append(getSdMilCoordinate()).append(getSdSpeed()).append(getSdLon()).append(getSdLat()).append(getSdMilRFID()).append(getSdStatus()).append(getSdReserve());
		sb.append(InfoUtils.CRC_16(InfoUtils.HexString2Bytes(sb.toString())));
		return sb.toString();
	}
	public String toRSString() {
		StringBuffer sb=new StringBuffer("6900018339");
		sb.append(this.getSdDate()).append(getSdTrackNo()).append(getSdAreaNo()).append(getSdFlag()).append(getSdMilCoordinate()).append(getSdSpeed()).append(getSdLon()).append(getSdLat()).append(getSdMilRFID()).append(getSdStatus()).append(getSdReserve());
		sb.append(InfoUtils.CRC_16(InfoUtils.HexString2Bytes(sb.toString())));
		return sb.toString();
	}
	
}
